<?php

class Create_Taobao_Products_Table {

  /**
   * Make changes to the database.
   *
   * @return void
   */
  public function up() {
    Schema::create('taobao_products', function($table) {
      $table->increments('id');
      $table->string('num_iid');
      $table->string('seller_id');
      $table->string('nick');
      $table->string('title');
      $table->decimal('price', 8, 2);
      $table->string('item_location');
      $table->string('seller_credit_score');
      $table->string('click_url');
      $table->string('shop_click_url');
      $table->string('pic_url');
      $table->string('keyword_click_url');
      $table->integer('coupon_rate');
      $table->decimal('coupon_price', 8, 2);
      $table->date('coupon_start_time');
      $table->date('coupon_end_time');
      $table->decimal('commission_rate', 8, 2);
      $table->decimal('commission', 8, 2);
      $table->decimal('commission_volume', 8, 2);
      $table->integer('volume');
      $table->string('shop_type');
      $table->timestamps();
    });
  }

  /**
   * Revert the changes to the database.
   *
   * @return void
   */
  public function down() {
    Schema::drop('taobao_products');
  }

}
